1. Field of the Invention
The present invention relates to a machining time estimation apparatus for estimating the machining time of a numerical control (NC) machine tool by analyzing an NC program for controlling the drive mechanisms of the NC machine tool.
2. Description of the Prior Art
As a conventional machining time estimation apparatus, an apparatus disclosed in Japanese Unexamined Utility Model Publication No. 5-63749 is known. This machining time estimation apparatus comprises a machining program storage section, a program interpreting section, an axis feed speed data storage section, an axis movement time calculation section, an MST operation time calculation section, an addition section, an MST operation time data storage section, a general-purpose M-code operation time data storage section, etc.
The program interpreting section reads an NC program stored in an NC program storage section, block by block, and interprets its contents and transmits axis movement commands and MST commands serving as miscellaneous function operation commands so as to be distributed to the axis movement time calculation section and the MST operation time calculation section, respectively. The miscellaneous functions are functions commanded as M, S and T codes in a machining program. Usually, M codes relate to spindle normal/reverse rotation commands, tool change commands, etc., S codes relate to spindle rotation speed, and T codes relate to tool designation, for example.
The axis movement time calculation section obtains the amount of axis movement on the basis of the axis movement commands transmitted from the program interpreting section, calculates an axis movement time on the basis of the obtained amount of the axis movement and the axis feed speed data stored in the axis feed speed data storage section, and transmits the time to the addition section.
On the other hand, the MST operation time calculation section reads applicable data from MST operation time data preset at each operation and stored in the MST operation time data storage section and the general-purpose M-code operation time data storage section on the basis of the MST commands transmitted from the program interpreting section and transmits the MST operation time obtained from the read data to the addition section. General-purpose M codes are codes allocated so as to be usable as desired by a user. Data on the operation time of the function set by the user is preset and stored in the general-purpose M-code operation time data storage section.
The addition section adds each operation time transmitted from the axis movement time calculation section and the MST operation time calculation section to calculate a machining time.
Hence, with this machining time estimation apparatus, the time required for applicable machining (machining time) can be known in advance from a machining program to be used for the machining, whereby it is possible to devise a detailed machining plan for a product to be obtained by the machining.
However, in actual practice, the axis movement time and the MST operation time are different depending on the kind of a machine tool and the state of the machine tool. In particular, the MST operation time changes frequently depending on a lapse of time and the incessantly changing state of the machine tool. For example, regarding the rotation of the spindle, the time required to reach its commanded rotation speed from the spindle stop state differs depending on the weight of a workpiece to be machined and the commanded rotation speed. In addition, when a tool is indexed to a machining position by swiveling the turret, the operation time differs depending on the interval between the currently indexed tool and the tool to be indexed next. Furthermore, the operation time changes depending on the change in the frictional resistance of the sliding portion. When the sliding portion is driven by hydraulic or pneumatic pressure, the operation time changes depending on the state of the pressure.
In the above-mentioned conventional machining time estimation apparatus, when the MST operation time is calculated, applicable operation time data is read from the operation time data preset as a fixed value regarding each MST operation and stored in the storage section, and the data is allocated as the MST operation time. Hence, when the actual MST operation time changes depending on a lapse of time and the incessantly changing state of the machine tool as described above, a problem of being incapable of accurate machining time calculation is caused.
For this reason, when a machining time is calculated by the above-mentioned conventional machining time estimation apparatus and when machining is carried out in accordance with a machining plan devised on the basis of the calculated machining times, the machining plan is deranged.
Accordingly, the present invention is intended to provide a machining time estimation apparatus capable of accurate machining time calculation.
The present invention for solving the above-mentioned problems relates to a machining time estimation apparatus for an NC machine tool, which estimates the machining time of the NC machine tool, comprising:
a program storage section for storing an NC program formed of a plurality of command blocks,
a program analysis section for reading the NC program stored in the program storage section, for analyzing the NC program, block by block, and for outputting a control signal on the basis of the result of the analysis,
a drive control section for receiving the control signal output from the program analysis section and for controlling the operation of each drive mechanism concerned with the axis movement and miscellaneous functions of the NC machine tool on the basis of the received control signal, wherein the machining time estimation apparatus further comprises:
a database for storing the actual operation time data of the drive mechanism concerned with the miscellaneous functions,
actual operation time calculation means for calculating the actual operation time of the drive mechanism concerned with at least the miscellaneous functions on the basis of the control signal output from the program analysis section and an operation completion signal obtained from the drive mechanism and for updating the data stored in the database by using data on the calculated actual operation time, and
operation time estimation means for analyzing each block of the NC program stored in the program storage section, for calculating the estimated operation time of the drive mechanism concerned with the axis movement on the basis of the result of the analysis, for estimating the operation time of the drive mechanism concerned with the miscellaneous functions by searching the database on the basis of the result of the analysis, for calculating the estimated operation time of each block on the basis of the estimated operation time of the drive mechanism concerned with the axis movement and the estimated operation time of the drive mechanism concerned with the miscellaneous functions, and for calculating the estimated machining time by totalizing the estimated operation time of each block.
With this machining time estimation apparatus, each time actual machining is carried out on the machine tool, the actual operation time of the drive mechanism concerned with at least the miscellaneous functions is calculated by the actual operation time calculation means. The data stored in the database is updated by the data on the calculated actual operation time. By this updating process, the reliability of the data stored in the database is enhanced.
The miscellaneous functions are functions other than axis movement functions and they are commanded as M, S and T codes in an NC program. Usually, M codes relate to spindle normal/reverse rotation commands, tool change commands, etc., S codes relate to spindle rotation speed, and T codes relate to tool designation, for example. The drive mechanisms for the miscellaneous functions are a mechanism for rotating the spindle and a mechanism for swiveling the turret, for example.
Furthermore, the updating process may be carried out by replacing the data stored in the database with the data on the calculated actual operation time. However, it is preferable that the actual operation time currently calculated is added to the total of the actual operation times calculated in the past thereby to calculate the average value thereof, and that the data stored in the database is replaced with the data on the calculated average value. With this configuration, noise can be eliminated, and a database conforming to the actual state can be obtained.
The operation time estimation means then carries out a machining time estimation process by using the database, the reliability of which is enhanced as described above. In other words, the NC program stored in the program storage section is analyzed, block by block. In the case when an axis movement command is issued, the amount of the axis movement is obtained on the basis of the axis movement command, and the estimated operation time of the axis movement is calculated on the basis of the obtained amount of the axis movement and a commanded axis feed speed. In the case when a miscellaneous function operation is commanded, the database is searched on the basis of the miscellaneous function operation command thereby to obtain the operation time of the miscellaneous function.
Furthermore, in the case when either the axis movement command or the miscellaneous function operation command is issued in one block, the time obtained by the above-mentioned process is used as the estimated operation time of the block. On the other hand, in the case when both the axis movement command and the miscellaneous function operation command are issued in one block and when the axis movement and the miscellaneous function operation are carried out sequentially, the time obtained by the above-mentioned process is added, and the resultant time is used as the estimated operation time of the block. In the case when the axis movement and the miscellaneous function operation are carried out in parallel with each other, the longer time of the times obtained by the above-mentioned process is used as the estimated operation time of the block.
After the estimated operation time of each block is calculated as described above, these estimated operation times are totalized to obtain an estimated machining time.
Hence, in this machining time estimation apparatus, regardless of the change of the actual operation time regarding the miscellaneous function with respect to time and with respect to the incessantly changing state of the machine tool, the machining time is calculated by using the database reflecting these actual states. Therefore, a highly accurate machining time conforming to the actual state of the machine tool can be calculated. For this reason, a machining plan to be devised by using this machining time can be made highly reliable.
In addition to carrying out the above-mentioned process, the actual operation time calculation means may be configured to calculate the actual operation time of the drive mechanism concerned with the axis movement on the basis of the control signal output from the program analysis section and the operation completion signal obtained from the drive mechanism, to calculate the actual operation time of each block on the basis of the calculated actual operation time of the drive mechanism concerned with the axis movement and the calculated actual operation time of the drive mechanism concerned with the miscellaneous function and to calculate an actual machining time by totalizing the calculated actual operation time of each block.
With this configuration, by comparing the actual operation time of each block and the actual machining time calculated by the actual operation time calculation means with the estimated operation time of each block and the estimated machining time calculated by the operation time estimation means, a check as to whether the result of the estimation conforms to the actual state of the machine tool or not can be carried out.
This kind of check can be carried out automatically by using a configuration, in addition to the above-mentioned configuration, comprising machining time storage means for storing data on the time calculated by the actual operation time calculation means and the time calculated by the operation time estimation means, and evaluation means for evaluating the operation state of the drive mechanism by comparing the time data calculated by the actual operation time calculation means and stored in the machining time storage means with the time data calculated by the operation time estimation means and stored in the machining time storage means.
Furthermore, the evaluation means may be configured to compare the actual operation time data of each block and the actual machining time data calculated by the actual operation time calculation means with the estimated operation time data of each block and the estimated machining time data calculated by the operation time estimation means and to calculate the error rate therebetween. Moreover, when the calculated error rate exceeds a predetermined allowable value, the evaluation means may also be configured to output an alarm. In this case, it is more preferable that if the cause of the alarm is known, the cause is also output together with the alarm.
Still further, the apparatus may also be provided with program generating means for receiving the input of command codes corresponding to the miscellaneous functions from the outside, for automatically generating an NC program, that operates the drive mechanisms concerned with the miscellaneous functions and is used to update the database, on the basis of the received command codes, and for storing the automatically generated NC program in the program storage section. With this configuration, by operating the NC machine tool in accordance with the NC program generated by the program generating means, the database can be updated without carrying out actual machining. Hence, the reliability of the database can be enhanced efficiently.